package app.common.utils.cjt.ao;

import com.alibaba.fastjson.JSON;
import lombok.Data;

import java.util.Collections;
import java.util.Map;
import java.util.TreeMap;

/**
 * <b>wms.stockout.Other.createOther（其他出库单新建）</b>
 * @author feizns
 * @since 2023/3/21
 */
@Data
public class WmsStockoutOtherCreateOtherAo {


    private String outer_no;
    private String warehouse_no;
    private String spec_no;
    private String num;

    //货位编号
    private String position_no;

    /**
     * 备注
     */
    private String remark;

    /**
     * 是否是检查
     */
    private Boolean is_check;

    public Map<String, Object> toMap() {
        Map<String, Object> map = new TreeMap<>();
        map.put("outer_no", outer_no);
        map.put("warehouse_no", warehouse_no);
        map.put("remark", remark);
        map.put("is_check", is_check);
        map.put("goods_list", Collections.singletonList(toSubMap()));
        return map;
    }

    public Map<String, Object> toSubMap() {
        Map<String, Object> map = new TreeMap<>();
        map.put("spec_no", spec_no);
        map.put("num", num);
        map.put("position_no", position_no);
        return map;
    }

    public String toData() {
        return JSON.toJSONString(Collections.singletonList(toMap()));
    }

}
